/****************************************************************************************** 
 *	Chili DirectX Framework Version 12.10.21											  *	
 *	Game.cpp																			  *
 *	Copyright 2012 PlanetChili.net														  *
 *																						  *
 *	This file is part of The Chili DirectX Framework.									  *
 *																						  *
 *	The Chili DirectX Framework is free software: you can redistribute it and/or modify	  *
 *	it under the terms of the GNU General Public License as published by				  *
 *	the Free Software Foundation, either version 3 of the License, or					  *
 *	(at your option) any later version.													  *
 *																						  *
 *	The Chili DirectX Framework is distributed in the hope that it will be useful,		  *
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of						  *
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the						  *
 *	GNU General Public License for more details.										  *
 *																						  *
 *	You should have received a copy of the GNU General Public License					  *
 *	along with The Chili DirectX Framework.  If not, see <http://www.gnu.org/licenses/>.  *
 ******************************************************************************************/
#include "game.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <float.h>

Game::Game( HWND hWnd,KeyboardServer& kServer,const MouseServer& mServer )
:	gfx( hWnd ),
	kbd( kServer ),
	mouse( mServer )
{
	/* Give a seed to the random number generator. Only needs to be done once in the program's lifetime */
	srand( (unsigned int)time( NULL ) ); // Seed is the current time
}

/* Destructor for game object, right now it doesn't do shit */
Game::~Game()
{
}

void Game::Go()
{
	/* Do some preprocessing, for example draw an all black screen */
	gfx.BeginFrame();

	/* Right now we just run the world 
		but here we could also have other game states,
		for example a pause menu
	*/
	world.process_frame( gfx, kbd );

	/* Do some end processing, and move the frame to the graphics card, and switch to the backbuffer on the graphics card */
	gfx.EndFrame();
}